home *** CD-ROM | disk | FTP | other *** search
Text File | 2001-01-01 | 25.8 KB | 1,042 lines |
- *** ORIG/diff/diff3.c Tue Apr 24 18:14:52 2001
- --- diff/diff3.c Mon Jul 23 23:45:05 2001
- ***************
- *** 1326,1332 ****
- if (wstatus == 2)
- diff3_fatal ("subsidiary diff failed");
-
- ! if (-1 == (fd = open (diffout, O_RDONLY)))
- diff3_fatal ("could not open temporary diff file");
-
- current_chunk_size = 8 * 1024;
- --- 1326,1332 ----
- if (wstatus == 2)
- diff3_fatal ("subsidiary diff failed");
-
- ! if (-1 == (fd = open (diffout, O_RDONLY, 0))) /* Amiga */
- diff3_fatal ("could not open temporary diff file");
-
- current_chunk_size = 8 * 1024;
- *** ORIG/diff/system.h Thu Apr 19 19:45:28 2001
- --- diff/system.h Mon Jul 23 23:45:05 2001
- ***************
- *** 270,275 ****
- --- 270,279 ----
- }
- #endif
-
- + #ifdef AMIGA
- + #include "amiga.h"
- + #endif /* AMIGA */
- +
- /* these come from CVS's lib/system.h, but I wasn't sure how to include that
- * properly or even if I really should
- */
- *** ORIG/lib/getopt.c Wed Feb 28 14:49:39 2001
- --- lib/getopt.c Mon Jul 23 23:45:05 2001
- ***************
- *** 66,71 ****
- --- 66,75 ----
- #include <stdlib.h>
- #endif /* GNU C library. */
-
- + #ifdef AMIGA
- + #include <stdlib.h>
- + #endif /* AMIGA */
- +
- /* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
- *** ORIG/lib/getopt.h Thu Apr 19 19:45:30 2001
- --- lib/getopt.h Mon Jul 23 23:45:05 2001
- ***************
- *** 97,103 ****
- --- 97,107 ----
- exactly why), and there is no particular need to prototype it.
- We really shouldn't be trampling on the system's namespace at all by
- declaring getopt() but that is a bigger issue. */
- + #ifdef AMIGA
- + extern int getopt (int argc, char * const *argv, const char *optstring);
- + #else
- extern int getopt ();
- + #endif
-
- extern int getopt_long (int argc, char *const *argv, const char *shortopts,
- const struct option *longopts, int *longind);
- *** ORIG/lib/regex.c Thu Apr 19 19:45:30 2001
- --- lib/regex.c Mon Jul 23 23:52:46 2001
- ***************
- *** 145,151 ****
- static char re_syntax_table[CHAR_SET_SIZE];
-
- static void
- ! init_syntax_once ()
- {
- register int c;
- static int done = 0;
- --- 145,151 ----
- static char re_syntax_table[CHAR_SET_SIZE];
-
- static void
- ! init_syntax_once (void)
- {
- register int c;
- static int done = 0;
- ***************
- *** 358,364 ****
- #define false 0
- #define true 1
-
- ! static int re_match_2_internal ();
-
- /* These are the command codes that appear in compiled regular
- expressions. Some opcodes are followed by argument bytes. A
- --- 358,366 ----
- #define false 0
- #define true 1
-
- ! static int re_match_2_internal(struct re_pattern_buffer *bufp, const char *string1,
- ! int size1, const char *string2, int size2, int pos,
- ! struct re_registers *regs, int stop); /* AMiGA */
-
- /* These are the command codes that appear in compiled regular
- expressions. Some opcodes are followed by argument bytes. A
- ***************
- *** 540,548 ****
-
- #ifdef DEBUG
- static void
- ! extract_number (dest, source)
- ! int *dest;
- ! unsigned char *source;
- {
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
- *dest = *source & 0377;
- --- 542,548 ----
-
- #ifdef DEBUG
- static void
- ! extract_number (int *dest, unsigned char *source) /* AMiGA */
- {
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
- *dest = *source & 0377;
- ***************
- *** 567,575 ****
-
- #ifdef DEBUG
- static void
- ! extract_number_and_incr (destination, source)
- ! int *destination;
- ! unsigned char **source;
- {
- extract_number (destination, *source);
- *source += 2;
- --- 567,573 ----
-
- #ifdef DEBUG
- static void
- ! extract_number_and_incr (int *destination, unsigned char **source) /* AMiGA */
- {
- extract_number (destination, *source);
- *source += 2;
- ***************
- *** 1530,1540 ****
-
- /* Subroutine declarations and macros for regex_compile. */
-
- ! static void store_op1 (), store_op2 ();
- ! static void insert_op1 (), insert_op2 ();
- ! static boolean at_begline_loc_p (), at_endline_loc_p ();
- ! static boolean group_in_compile_stack ();
- ! static reg_errcode_t compile_range ();
-
- /* Fetch the next character in the uncompiled pattern---translating it
- if necessary. Also cast from a signed character in the constant
- --- 1528,1541 ----
-
- /* Subroutine declarations and macros for regex_compile. */
-
- ! /* AMiGA */
- ! static void store_op1(re_opcode_t op, unsigned char *loc, int arg);
- ! static void store_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2);
- ! static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end);
- ! static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end);
- ! static boolean at_begline_loc_p(const char *pattern, const char *p, reg_syntax_t syntax);
- ! static boolean at_endline_loc_p(const char *p, const char *pend, int syntax);
- ! static boolean group_in_compile_stack(struct compile_stack_type compile_stack, unsigned regnum);
-
- /* Fetch the next character in the uncompiled pattern---translating it
- if necessary. Also cast from a signed character in the constant
- ***************
- *** 1687,1693 ****
- } compile_stack_elt_t;
-
-
- ! typedef struct
- {
- compile_stack_elt_t *stack;
- unsigned size;
- --- 1688,1694 ----
- } compile_stack_elt_t;
-
-
- ! typedef struct compile_stack_type
- {
- compile_stack_elt_t *stack;
- unsigned size;
- ***************
- *** 1809,1816 ****
- but don't make them smaller. */
-
- static
- ! regex_grow_registers (num_regs)
- ! int num_regs;
- {
- if (num_regs > regs_allocated_size)
- {
- --- 1810,1816 ----
- but don't make them smaller. */
-
- static
- ! regex_grow_registers(int num_regs) /* AMiGA */
- {
- if (num_regs > regs_allocated_size)
- {
- ***************
- *** 1857,1867 ****
- } while (0)
-
- static reg_errcode_t
- ! regex_compile (pattern, size, syntax, bufp)
- ! const char *pattern;
- ! int size;
- ! reg_syntax_t syntax;
- ! struct re_pattern_buffer *bufp;
- {
- /* We fetch characters from PATTERN here. Even though PATTERN is
- `char *' (i.e., signed), we declare these variables as unsigned, so
- --- 1857,1865 ----
- } while (0)
-
- static reg_errcode_t
- ! regex_compile (const char *pattern, int size,
- ! reg_syntax_t syntax,
- ! struct re_pattern_buffer *bufp) /* AMiGA */
- {
- /* We fetch characters from PATTERN here. Even though PATTERN is
- `char *' (i.e., signed), we declare these variables as unsigned, so
- ***************
- *** 3107,3117 ****
- const char *prev = p - 2;
- boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
- ! return
- /* After a subexpression? */
- (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
- /* After an alternative? */
- ! || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
- }
-
-
- --- 3105,3115 ----
- const char *prev = p - 2;
- boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
- ! return (boolean)( /* AMiGA */
- /* After a subexpression? */
- (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
- /* After an alternative? */
- ! || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)));
- }
-
-
- ***************
- *** 3127,3139 ****
- boolean next_backslash = *next == '\\';
- const char *next_next = p + 1 < pend ? p + 1 : 0;
-
- ! return
- /* Before a subexpression? */
- (syntax & RE_NO_BK_PARENS ? *next == ')'
- : next_backslash && next_next && *next_next == ')')
- /* Before an alternative? */
- || (syntax & RE_NO_BK_VBAR ? *next == '|'
- ! : next_backslash && next_next && *next_next == '|');
- }
-
-
- --- 3125,3137 ----
- boolean next_backslash = *next == '\\';
- const char *next_next = p + 1 < pend ? p + 1 : 0;
-
- ! return (boolean)( /* AMiGA */
- /* Before a subexpression? */
- (syntax & RE_NO_BK_PARENS ? *next == ')'
- : next_backslash && next_next && *next_next == ')')
- /* Before an alternative? */
- || (syntax & RE_NO_BK_VBAR ? *next == '|'
- ! : next_backslash && next_next && *next_next == '|'));
- }
-
-
- ***************
- *** 3937,3946 ****
-
- /* Declarations and macros for re_match_2. */
-
- ! static int bcmp_translate ();
- ! static boolean alt_match_null_string_p (),
- ! common_op_match_null_string_p (),
- ! group_match_null_string_p ();
-
- /* This converts PTR, a pointer into one of the search strings `string1'
- and `string2' into an offset from the beginning of that string. */
- --- 3935,3945 ----
-
- /* Declarations and macros for re_match_2. */
-
- ! /* AMiGA */
- ! static int bcmp_translate(unsigned char *s1, unsigned char *s2, int len, RE_TRANSLATE_TYPE translate);
- ! static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info);
- ! static boolean common_op_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info);
- ! static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info);
-
- /* This converts PTR, a pointer into one of the search strings `string1'
- and `string2' into an offset from the beginning of that string. */
- *** ORIG/lib/regex.h Thu Apr 19 19:45:30 2001
- --- lib/regex.h Mon Jul 23 23:45:05 2001
- ***************
- *** 485,493 ****
- #ifdef _REGEX_RE_COMP
- /* 4.2 bsd compatibility. */
- /* CVS: don't use prototypes: they may conflict with system headers. */
- extern char *re_comp _RE_ARGS (());
- extern int re_exec _RE_ARGS (());
- ! #endif
-
- /* POSIX compatibility. */
- extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
- --- 485,499 ----
- #ifdef _REGEX_RE_COMP
- /* 4.2 bsd compatibility. */
- /* CVS: don't use prototypes: they may conflict with system headers. */
- + #ifdef AMIGA
- + extern char *re_comp _RE_ARGS((const char *s));
- + extern int re_exec _RE_ARGS((const char *s));
- + #else
- extern char *re_comp _RE_ARGS (());
- extern int re_exec _RE_ARGS (());
- ! #endif /* AMIGA */
- !
- ! #endif /* _REGEX_RE_COMP */
-
- /* POSIX compatibility. */
- extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
- *** ORIG/lib/sighandle.c Thu Apr 19 19:45:30 2001
- --- lib/sighandle.c Mon Jul 23 23:54:40 2001
- ***************
- *** 65,71 ****
-
- /* Define linked list of signal handlers structure */
- struct SIG_hlist {
- ! RETSIGTYPE (*handler)();
- struct SIG_hlist *next;
- };
-
- --- 65,71 ----
-
- /* Define linked list of signal handlers structure */
- struct SIG_hlist {
- ! RETSIGTYPE (*handler)(int sig); /* AMiGA */
- struct SIG_hlist *next;
- };
-
- *** ORIG/lib/system.h Thu Apr 19 19:45:30 2001
- --- lib/system.h Mon Jul 23 23:45:06 2001
- ***************
- *** 477,482 ****
- --- 477,490 ----
-
- #endif /* defined (__CYGWIN32__) || defined (WIN32) */
-
- + #ifdef AMIGA
- + #include "amiga.h"
- +
- + #define FOLD_FN_CHAR(c) amiga_fold_fn_char(c)
- + #define FILENAMES_CASE_INSENSITIVE 1
- + #define ISDIRSEP(c) ((c) == ':' || (c) == '/')
- + #endif /* AMIGA */
- +
- /* Some file systems are case-insensitive. If FOLD_FN_CHAR is
- #defined, it maps the character C onto its "canonical" form. In a
- case-insensitive system, it would map all alphanumeric characters
- *** ORIG/lib/xgetwd.c Thu Apr 19 19:29:03 2001
- --- lib/xgetwd.c Mon Jul 23 23:45:06 2001
- ***************
- *** 29,36 ****
- --- 29,41 ----
- /* Amount by which to increase buffer size when allocating more space. */
- #define PATH_INCR 32
-
- + #ifdef AMIGA
- + char *xmalloc(size_t);
- + char *xrealloc(void *ptr, size_t bytes);
- + #else
- char *xmalloc ();
- char *xrealloc ();
- + #endif /* AMIGA */
-
- /* Return the current directory, newly allocated, arbitrarily long.
- Return NULL and set errno on error. */
- *** ORIG/lib/xtime.h Thu Feb 15 02:53:07 2001
- --- lib/xtime.h Mon Jul 23 23:45:06 2001
- ***************
- *** 27,32 ****
- --- 27,36 ----
- # endif /* !HAVE_SYS_TIME_H */
- # endif /* !TIME_WITH_SYS_TIME */
-
- + # ifdef timezone
- + # undef timezone /* needed for sgi */
- + # endif /* timezone */
- +
- # ifdef HAVE_SYS_TIMEB_H
- # include <sys/timeb.h>
- # else /* HAVE_SYS_TIMEB_H */
- ***************
- *** 45,54 ****
- short dstflag; /* Field not used */
- };
- # endif /* !HAVE_SYS_TIMEB_H */
- -
- - # ifdef timezone
- - # undef timezone /* needed for sgi */
- - # endif /* timezone */
-
- # if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
- extern long timezone;
- --- 49,54 ----
- *** ORIG/src/client.c Tue Apr 24 18:14:53 2001
- --- src/client.c Mon Jul 23 23:57:05 2001
- ***************
- *** 3430,3436 ****
-
- memcpy (buf, data, nread);
-
- ! return nread;
- }
-
- /*
- --- 3430,3436 ----
-
- memcpy (buf, data, nread);
-
- ! return (size_t)nread; /* AMiGA */
- }
-
- /*
- ***************
- *** 3811,3817 ****
-
- if (resultp == NULL)
- free (result);
- ! return input_index;
- }
-
- /* Connect to a forked server process. */
- --- 3811,3817 ----
-
- if (resultp == NULL)
- free (result);
- ! return (int)input_index; /* AMiGA */
- }
-
- /* Connect to a forked server process. */
- ***************
- *** 4418,4426 ****
- same. */
- if (tofd == fromfd)
- {
- ! fromfd = dup (tofd);
- ! if (fromfd < 0)
- ! error (1, errno, "cannot dup net connection");
- }
-
- /* These will use binary mode on systems which have it. */
- --- 4418,4430 ----
- same. */
- if (tofd == fromfd)
- {
- ! #ifdef AMIGA
- ! fprintf(stderr,"HELP! dup() called!\n");
- ! #else
- ! fromfd = dup (tofd);
- ! if (fromfd < 0)
- ! error (1, errno, "cannot dup net connection");
- ! #endif /* AMIGA */
- }
-
- /* These will use binary mode on systems which have it. */
- ***************
- *** 5014,5020 ****
- else
- fd = CVS_OPEN (file, O_RDONLY | OPEN_BINARY);
- #else
- ! fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0));
- #endif
-
- if (fd < 0)
- --- 5018,5024 ----
- else
- fd = CVS_OPEN (file, O_RDONLY | OPEN_BINARY);
- #else
- ! fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0), 0); /* AMiGA */
- #endif
-
- if (fd < 0)
- *** ORIG/src/cvs.h Tue Apr 24 18:14:53 2001
- --- src/cvs.h Mon Jul 23 23:45:06 2001
- ***************
- *** 58,63 ****
- --- 58,67 ----
- #include <strings.h>
- #endif
-
- + #ifdef AMIGA
- + #include "amiga.h"
- + #endif /* AMIGA */
- +
- #ifdef SERVER_SUPPORT
- /* If the system doesn't provide strerror, it won't be declared in
- string.h. */
- *** ORIG/src/filesubr.c Thu Apr 19 19:45:32 2001
- --- src/filesubr.c Tue Jul 24 00:00:14 2001
- ***************
- *** 63,69 ****
- else
- {
- /* Not a link or a device... probably a regular file. */
- ! if ((fdin = open (from, O_RDONLY)) < 0)
- error (1, errno, "cannot open %s for copying", from);
- if (fstat (fdin, &sb) < 0)
- error (1, errno, "cannot fstat %s", from);
- --- 63,69 ----
- else
- {
- /* Not a link or a device... probably a regular file. */
- ! if ((fdin = open (from, O_RDONLY, 0)) < 0) /* AMiGA */
- error (1, errno, "cannot open %s for copying", from);
- if (fstat (fdin, &sb) < 0)
- error (1, errno, "cannot fstat %s", from);
- ***************
- *** 110,115 ****
- --- 110,119 ----
- t.actime = sb.st_atime;
- t.modtime = sb.st_mtime;
- (void) utime (to, &t);
- +
- + #ifdef AMIGA
- + (void) chmod (to, sb.st_mode);
- + #endif /* AMIGA */
- }
-
- /* FIXME-krp: these functions would benefit from caching the char * &
- ***************
- *** 427,432 ****
- --- 431,437 ----
- * removal of all of the files in the directory. Return -1 on error
- * (in which case errno is set).
- */
- + #ifndef AMIGA
- int
- unlink_file_dir (f)
- const char *f;
- ***************
- *** 467,472 ****
- --- 472,478 ----
-
- return CVS_UNLINK (f);
- }
- + #endif /* AMIGA */
-
- /* Remove a directory and everything it contains. Returns 0 for
- * success, -1 for failure (in which case errno is set).
- ***************
- *** 580,586 ****
- nchars -= nread;
- } while (nchars != 0);
-
- ! return bp - buf;
- }
-
-
- --- 586,592 ----
- nchars -= nread;
- } while (nchars != 0);
-
- ! return (size_t)(bp - buf); /* AMiGA */
- }
-
-
- ***************
- *** 621,626 ****
- --- 627,633 ----
- return result;
- }
-
- + #ifndef AMIGA
- /* If FILE1 and FILE2 are devices, they are equal if their device
- numbers match. */
- if (S_ISBLK (sb1.st_mode) || S_ISCHR (sb1.st_mode))
- ***************
- *** 635,645 ****
- file1, file2);
- #endif
- }
-
- ! if ((fd1 = open (file1, O_RDONLY)) < 0)
- ! error (1, errno, "cannot open file %s for comparing", file1);
- ! if ((fd2 = open (file2, O_RDONLY)) < 0)
- ! error (1, errno, "cannot open file %s for comparing", file2);
-
- /* A generic file compare routine might compare st_dev & st_ino here
- to see if the two files being compared are actually the same file.
- --- 642,653 ----
- file1, file2);
- #endif
- }
- + #endif /* AMIGA */
-
- ! if ((fd1 = open (file1, O_RDONLY, 0 )) < 0) /* AMiGA */
- ! error (1, errno, "cannot open file %s for comparing", file1);
- ! if ((fd2 = open (file2, O_RDONLY, 0)) < 0) /* AMiGA */
- ! error (1, errno, "cannot open file %s for comparing", file2);
-
- /* A generic file compare routine might compare st_dev & st_ino here
- to see if the two files being compared are actually the same file.
- ***************
- *** 684,689 ****
- --- 692,698 ----
- return (ret);
- }
-
- + #ifndef AMIGA
- /* Generate a unique temporary filename. Returns a pointer to a newly
- * malloc'd string containing the name. Returns successfully or not at
- * all.
- ***************
- *** 707,712 ****
- --- 716,722 ----
- error (0, errno, "Failed to close temporary file %s", fn);
- return fn;
- }
- + #endif /* AMIGA */
-
- /* Generate a unique temporary filename and return an open file stream
- * to the truncated file by that name
- ***************
- *** 739,744 ****
- --- 749,755 ----
- * NFS locking thing, but until I hear of more problems, I'm not going to
- * bother.
- */
- + #ifndef AMIGA
- FILE *cvs_temp_file (filename)
- char **filename;
- {
- ***************
- *** 845,851 ****
- --- 856,864 ----
- *filename = fn;
- return fp;
- }
- + #endif /* AMIGA */
-
- + #ifndef AMIGA
- /* Return non-zero iff FILENAME is absolute.
- Trivial under Unix, but more complicated under other systems. */
- int
- ***************
- *** 854,859 ****
- --- 867,873 ----
- {
- return filename[0] == '/';
- }
- + #endif /* AMIGA */
-
- /*
- * Return a string (dynamically allocated) with the name of the file to which
- ***************
- *** 893,899 ****
- return tfile;
- }
-
- !
- /* Return a pointer into PATH's last component. */
- char *
- last_component (path)
- --- 907,913 ----
- return tfile;
- }
-
- ! #ifndef AMIGA
- /* Return a pointer into PATH's last component. */
- char *
- last_component (path)
- ***************
- *** 906,911 ****
- --- 920,926 ----
- else
- return path;
- }
- + #endif /* AMIGA */
-
- /* Return the home directory. Returns a pointer to storage
- managed by this function or its callees (currently getenv).
- ***************
- *** 955,960 ****
- --- 970,976 ----
- return home;
- }
-
- + #ifndef AMIGA
- /* See cvs.h for description. On unix this does nothing, because the
- shell expands the wildcards. */
- void
- ***************
- *** 970,975 ****
- --- 986,992 ----
- for (i = 0; i < argc; ++i)
- (*pargv)[i] = xstrdup (argv[i]);
- }
- + #endif /* AMIGA */
-
- #ifdef SERVER_SUPPORT
- /* Case-insensitive string compare. I know that some systems
- *** ORIG/src/hash.c Thu Apr 19 19:45:32 2001
- --- src/hash.c Tue Jul 24 00:01:18 2001
- ***************
- *** 21,28 ****
-
- /* hash function */
- static int
- ! hashp (key)
- ! const char *key;
- {
- unsigned int h = 0;
- unsigned int g;
- --- 21,27 ----
-
- /* hash function */
- static int
- ! hashp (const char *key) /* AMiGA */
- {
- unsigned int h = 0;
- unsigned int g;
- ***************
- *** 38,44 ****
- h = (h ^ (g >> 24)) ^ g;
- }
-
- ! return (h % HASHSIZE);
- }
-
- /*
- --- 37,43 ----
- h = (h ^ (g >> 24)) ^ g;
- }
-
- ! return (int)(h % HASHSIZE); /* AMiGA */
- }
-
- /*
- ***************
- *** 184,190 ****
- freenode_mem (p)
- Node *p;
- {
- ! if (p->delproc != (void (*) ()) NULL)
- p->delproc (p); /* call the specified delproc */
- else
- {
- --- 183,189 ----
- freenode_mem (p)
- Node *p;
- {
- ! if (p->delproc != (void (*) (void *)) NULL) /* AMiGA */
- p->delproc (p); /* call the specified delproc */
- else
- {
- ***************
- *** 196,202 ****
-
- /* to be safe, re-initialize these */
- p->key = p->data = (char *) NULL;
- ! p->delproc = (void (*) ()) NULL;
- }
-
- /*
- --- 195,201 ----
-
- /* to be safe, re-initialize these */
- p->key = p->data = (char *) NULL;
- ! p->delproc = (void (*) (void *)) NULL; /* AMiGA */
- }
-
- /*
- *** ORIG/src/hash.h Thu Apr 19 19:45:32 2001
- --- src/hash.h Mon Jul 23 23:45:07 2001
- ***************
- *** 11,16 ****
- --- 11,20 ----
- */
- #define HASHSIZE 151
-
- + #ifdef AMIGA
- + #undef NT_UNKNOWN
- + #endif /* AMIGA */
- +
- /*
- * Types of nodes
- */
- ***************
- *** 31,37 ****
- struct node *hashprev;
- char *key;
- char *data;
- ! void (*delproc) ();
- };
- typedef struct node Node;
-
- --- 35,41 ----
- struct node *hashprev;
- char *key;
- char *data;
- ! void (*delproc) (void *); /* AMiGA */
- };
- typedef struct node Node;
-
- *** ORIG/src/history.c Thu Apr 19 19:45:32 2001
- --- src/history.c Tue Jul 24 00:02:21 2001
- ***************
- *** 1061,1067 ****
- int fd;
- struct stat st_buf;
-
- ! if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY)) < 0)
- error (1, errno, "cannot open history file: %s", fname);
-
- if (fstat (fd, &st_buf) < 0)
- --- 1061,1067 ----
- int fd;
- struct stat st_buf;
-
- ! if ((fd = CVS_OPEN (fname, O_RDONLY | OPEN_BINARY, 0)) < 0) /* AMiGA */
- error (1, errno, "cannot open history file: %s", fname);
-
- if (fstat (fd, &st_buf) < 0)
- *** ORIG/src/main.c Fri Apr 27 19:57:23 2001
- --- src/main.c Tue Jul 24 00:03:22 2001
- ***************
- *** 18,24 ****
- --- 18,26 ----
- #ifdef HAVE_WINSOCK_H
- #include <winsock.h>
- #else
- + #ifndef AMIGA
- extern int gethostname ();
- + #endif /* AMIGA */
- #endif
-
- char *program_name;
- ***************
- *** 99,105 ****
- char *nick1;
- char *nick2;
-
- ! int (*func) (); /* Function takes (argc, argv) arguments. */
- unsigned long attr; /* Attributes. */
- } cmds[] =
-
- --- 101,107 ----
- char *nick1;
- char *nick2;
-
- ! int (*func) (int argc, char ** argv); /* Function takes (argc, argv) arguments. */ /* AMiGA */
- unsigned long attr; /* Attributes. */
- } cmds[] =
-
- *** ORIG/src/run.c Thu Apr 19 19:45:33 2001
- --- src/run.c Tue Jul 24 00:04:15 2001
- ***************
- *** 98,103 ****
- --- 98,182 ----
- const char *sterr;
- int flags;
- {
- + #ifdef AMIGA
- + int len,total_len,quotes,escape,result,i,j;
- + char * s;
- + char * arg;
- + char * command;
- +
- + if (noexec && (flags & RUN_REALLY) == 0)
- + return (0);
- +
- + total_len = 0;
- + for (i = 0; i < run_argc; i++)
- + {
- + arg = run_argv[i];
- + len = strlen(arg);
- + quotes = 0;
- +
- + for(j = 0 ; j < len ; j++)
- + {
- + if(arg[j] == ' ' && quotes == 0)
- + quotes = 2;
- + else if (arg[j] == '\"')
- + total_len++;
- + }
- +
- + total_len += len + quotes + 1;
- + }
- +
- + command = malloc(total_len+1);
- + if(command == NULL)
- + {
- + errno = ENOMEM;
- + return(-1);
- + }
- +
- + s = command;
- +
- + for (i = 0; i < run_argc; i++)
- + {
- + arg = run_argv[i];
- + len = strlen(arg);
- + quotes = escape = 0;
- +
- + for(j = 0 ; j < len ; j++)
- + {
- + if(arg[j] == ' ')
- + quotes = 1;
- + else if (arg[j] == '\"')
- + escape = 1;
- +
- + if(quotes == 1 && escape == 1)
- + break;
- + }
- +
- + if(quotes)
- + (*s++) = '\"';
- +
- + for(j = 0 ; j < len ; j++)
- + {
- + if(arg[j] == '\"')
- + (*s++) = '*';
- +
- + (*s++) = arg[j];
- + }
- +
- + if(quotes)
- + (*s++) = '\"';
- +
- + if(i < run_argc-1)
- + (*s++) = ' ';
- + }
- +
- + (*s) = '\0';
- +
- + result = system(command);
- + free(command);
- +
- + return(0);
- +
- + #else
- int shin, shout, sherr;
- int mode_out, mode_err;
- int status;
- ***************
- *** 345,350 ****
- --- 424,431 ----
- if (rerrno)
- errno = rerrno;
- return (rc);
- +
- + #endif /* AMIGA */
- }
-
- void
- ***************
- *** 402,407 ****
- --- 483,495 ----
- int *tofdp;
- int *fromfdp;
- {
- + #ifdef AMIGA
- + int pid;
- +
- + pid = amiga_piped_child(command,tofdp,fromfdp);
- +
- + return(pid);
- + #else
- int pid;
- int to_child_pipe[2];
- int from_child_pipe[2];
- ***************
- *** 447,452 ****
- --- 535,541 ----
- *tofdp = to_child_pipe[1];
- *fromfdp = from_child_pipe[0];
- return pid;
- + #endif /* AMIGA */
- }
-
-
- ***************
- *** 454,461 ****
- close_on_exec (fd)
- int fd;
- {
- #ifdef F_SETFD
- if (fcntl (fd, F_SETFD, 1))
- ! error (1, errno, "can't set close-on-exec flag on %d", fd);
- #endif
- }
- --- 543,552 ----
- close_on_exec (fd)
- int fd;
- {
- + #ifndef AMIGA
- #ifdef F_SETFD
- if (fcntl (fd, F_SETFD, 1))
- ! error (1, errno, "can't set close-on-exec flag on %d", fd);
- #endif
- + #endif /* AMIGA */
- }
- *** ORIG/src/subr.c Thu Apr 19 19:34:04 2001
- --- src/subr.c Tue Jul 24 00:05:13 2001
- ***************
- *** 744,749 ****
- --- 744,750 ----
- newname = xreadlink (*filename);
- #else
- error (1, 0, "internal error: islink doesn't like readlink");
- + newname = ""; /* AMiGA */
- #endif
-
- if (isabsolute (newname))
- *** ORIG/zlib/zconf.h Thu Apr 19 19:34:06 2001
- --- zlib/zconf.h Mon Jul 23 23:45:07 2001
- ***************
- *** 276,279 ****
- --- 276,283 ----
- # pragma map(inflate_trees_free,"INTRFR")
- #endif
-
- + #ifdef AMIGA
- + #include "amiga.h"
- + #endif /* AMIGA */
- +
- #endif /* _ZCONF_H */
-